import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _Form from "antd/lib/form";
import React from "react";
import { ConfigStepContainer, StyledConfigRow } from "./index.style";
import ListConfig from "../ComponentsConfig/ListConfig";
import PromptConfig from "../ComponentsConfig/PromptConfig";

var ConfigStepThree = function ConfigStepThree(_ref) {
  var form = _ref.form,
      config = _ref.config;
  var getFieldDecorator = form.getFieldDecorator;
  return React.createElement(ConfigStepContainer, null, React.createElement(StyledConfigRow, null, getFieldDecorator("list", {
    initialValue: config.list
  })(React.createElement(ListConfig, null))), React.createElement(StyledConfigRow, null, getFieldDecorator("prompt", {
    initialValue: {
      alert: config.alert,
      notification: config.notification,
      tooltip: config.tooltip
    }
  })(React.createElement(PromptConfig, null))));
};

export default _Form.create({
  onValuesChange: function onValuesChange(props, field, values) {
    if (props.onChange) {
      var list = values.list,
          prompt = values.prompt;
      props.onChange(_objectSpread({
        list: list
      }, prompt));
    }
  }
})(ConfigStepThree);
